import { Avatar } from 'antd';
import classNames from 'classnames';
import BlueCard from '../BlueCard';
import styles from './index.modules.less';

const avatar = require('../../assets/image/头像.png');

function AvaCard({ title = '暂无', name = '暂无', border = true }) {
  if (!border)
    return (
      <div
        className={classNames({
          [styles.container]: true,
          [styles.border]: border,
        })}
      >
        <div className={styles.title}>{title}</div>
        <div className={styles.imageContainer}>
          <Avatar
            shape="square"
            size={220}
            icon={
              <svg
                t="1712402003212"
                className="icon"
                viewBox="0 0 1024 1024"
                version="1.1"
                xmlns="http://www.w3.org/2000/svg"
                p-id="4935"
                width="200"
                height="200"
              >
                <path
                  d="M518.4 217.6l25.6-12.8 25.6 12.8-6.4-25.6 12.8-19.2-19.2-6.4-12.8-19.2-12.8 19.2-19.2 6.4 12.8 19.2-6.4 25.6zM320 300.8v25.6c0 38.4 102.4 70.4 224 70.4S768 364.8 768 326.4v-19.2c-51.2-19.2-140.8-25.6-236.8-25.6-83.2 0-160 6.4-211.2 19.2z m-38.4-83.2c12.8 32 38.4 70.4 38.4 70.4v6.4c51.2-12.8 128-19.2 211.2-19.2 96 0 179.2 12.8 230.4 25.6v-12.8s25.6-44.8 38.4-70.4c6.4-12.8 12.8-32 12.8-44.8 0-12.8-6.4-19.2-19.2-25.6-25.6-19.2-108.8-57.6-147.2-76.8-6.4 0-19.2-6.4-32-6.4H544 473.6c-12.8 0-25.6 6.4-32 6.4-38.4 19.2-121.6 57.6-160 70.4-12.8 6.4-19.2 12.8-19.2 25.6 6.4 19.2 12.8 32 19.2 51.2z m211.2-102.4s12.8 6.4 25.6 6.4 25.6-12.8 25.6-12.8 12.8 12.8 25.6 12.8 25.6-6.4 25.6-6.4l19.2 25.6s-12.8 6.4-12.8 19.2c0 19.2 6.4 12.8 6.4 44.8 0 32-70.4 51.2-70.4 51.2s-64-12.8-64-51.2c6.4-25.6 12.8-25.6 12.8-44.8 0-6.4-12.8-19.2-12.8-19.2l19.2-25.6z m192 614.4c-25.6-6.4-44.8-19.2-44.8-25.6v-51.2s115.2-96 115.2-256v-25.6c-25.6 25.6-108.8 44.8-211.2 44.8s-185.6-19.2-211.2-51.2v25.6c0 160 115.2 256 115.2 256v57.6c0 12.8-25.6 25.6-38.4 32-243.2 38.4-281.6 166.4-281.6 192 12.8 89.6 352 96 409.6 96-12.8-32-32-89.6-32-179.2 0-32 38.4-32 38.4-32s38.4 0 38.4 32c0 83.2-19.2 147.2-32 179.2 51.2 0 403.2-6.4 409.6-96 0-25.6-38.4-153.6-275.2-198.4z m-147.2 89.6c-25.6 0-38.4-19.2-38.4-38.4 0-25.6 19.2-38.4 38.4-38.4s38.4 19.2 38.4 38.4-12.8 38.4-38.4 38.4z"
                  p-id="4936"
                  fill="#ffffff"
                ></path>
              </svg>
            }
          />
        </div>

        <div className={styles.name}>{name}</div>
      </div>
    );
  return (
    <BlueCard
      content={
        <div
          className={classNames({
            [styles.container]: true,
            [styles.border]: border,
          })}
        >
          <div className={styles.title}>{title}</div>
          <Avatar
            shape="square"
            size={130}
            icon={
              <svg
                t="1712402003212"
                className="icon"
                viewBox="0 0 1024 1024"
                version="1.1"
                xmlns="http://www.w3.org/2000/svg"
                p-id="4935"
                width="200"
                height="200"
              >
                <path
                  d="M518.4 217.6l25.6-12.8 25.6 12.8-6.4-25.6 12.8-19.2-19.2-6.4-12.8-19.2-12.8 19.2-19.2 6.4 12.8 19.2-6.4 25.6zM320 300.8v25.6c0 38.4 102.4 70.4 224 70.4S768 364.8 768 326.4v-19.2c-51.2-19.2-140.8-25.6-236.8-25.6-83.2 0-160 6.4-211.2 19.2z m-38.4-83.2c12.8 32 38.4 70.4 38.4 70.4v6.4c51.2-12.8 128-19.2 211.2-19.2 96 0 179.2 12.8 230.4 25.6v-12.8s25.6-44.8 38.4-70.4c6.4-12.8 12.8-32 12.8-44.8 0-12.8-6.4-19.2-19.2-25.6-25.6-19.2-108.8-57.6-147.2-76.8-6.4 0-19.2-6.4-32-6.4H544 473.6c-12.8 0-25.6 6.4-32 6.4-38.4 19.2-121.6 57.6-160 70.4-12.8 6.4-19.2 12.8-19.2 25.6 6.4 19.2 12.8 32 19.2 51.2z m211.2-102.4s12.8 6.4 25.6 6.4 25.6-12.8 25.6-12.8 12.8 12.8 25.6 12.8 25.6-6.4 25.6-6.4l19.2 25.6s-12.8 6.4-12.8 19.2c0 19.2 6.4 12.8 6.4 44.8 0 32-70.4 51.2-70.4 51.2s-64-12.8-64-51.2c6.4-25.6 12.8-25.6 12.8-44.8 0-6.4-12.8-19.2-12.8-19.2l19.2-25.6z m192 614.4c-25.6-6.4-44.8-19.2-44.8-25.6v-51.2s115.2-96 115.2-256v-25.6c-25.6 25.6-108.8 44.8-211.2 44.8s-185.6-19.2-211.2-51.2v25.6c0 160 115.2 256 115.2 256v57.6c0 12.8-25.6 25.6-38.4 32-243.2 38.4-281.6 166.4-281.6 192 12.8 89.6 352 96 409.6 96-12.8-32-32-89.6-32-179.2 0-32 38.4-32 38.4-32s38.4 0 38.4 32c0 83.2-19.2 147.2-32 179.2 51.2 0 403.2-6.4 409.6-96 0-25.6-38.4-153.6-275.2-198.4z m-147.2 89.6c-25.6 0-38.4-19.2-38.4-38.4 0-25.6 19.2-38.4 38.4-38.4s38.4 19.2 38.4 38.4-12.8 38.4-38.4 38.4z"
                  p-id="4936"
                  fill="#ffffff"
                ></path>
              </svg>
            }
          />

          <div className={styles.name}>{name}</div>
        </div>
      }
    />
  );
}

export default AvaCard;
